package com.cf.r1029_e;

import java.io.*;

public class b {

    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StreamTokenizer in = new StreamTokenizer(br);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        in.nextToken(); int T = (int) in.nval;
        while (T-- > 0) {
            solve();
        }
        out.flush();
        out.close();
        br.close();
    }

    static void solve() throws IOException {
        in.nextToken(); int n = (int) in.nval;
        int[] a = new int[n];
        a[0] = 1;
        for (int i = 1, j = n; i < n - 1; i++, j--) {
            a[i] = j;
        }
        a[n - 1] = 2;
        for (int num : a) out.print(num + " ");
        out.println();
    }
}
